package cn.tedu.dfxd.mapper;

import cn.tedu.dfxd.entity.CommentsInfo;
import cn.tedu.dfxd.entity.Item;
import cn.tedu.dfxd.entity.ItemDesc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//必须添加泛型,因为泛型对象与表关联
public interface ItemMapper extends BaseMapper<Item> {

    @Select("select * from item  where price < 10000 ORDER BY id desc  limit 1,3")
    List<Item> findItem();

    @Select("select * from item  where price <10000 ORDER BY id desc  limit 0,1")
    Item findItemRXD();


    @Select("select * from item  where price >=10000 ORDER BY id desc  limit 0,3")
    List<Item> recommendLimit();


    @Select("select * from item  where id = #{id}")
    Item recommendDetails(Integer id);

    @Select("select * from item_desc where id = #{id}")
    ItemDesc findItemIntroduce(Integer id);


    @Select("select * from item where item_cat_id = #{itemCatId}")
    List<Item> findItemCatList(Integer itemCatId);

    @Select("select * from item order by id desc limit 0,8")
    List<Item> recommendListCate();


    @Select("select * from item order by price desc limit 0,2")
    List<Item> priceMoreListCate();

    @Select("select * from item order by price desc limit 0,5")
    List<Item> rankingList();


    @Select("select * from item  limit 0,4")
    List<Item> menuList();
}
